package com.example.demo1.user.view.application;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.media.AudioClip;
import javafx.stage.Stage;


import java.io.IOException;
import java.net.URL;

public class LoginApplication extends Application {

    @Override
    public void start(Stage stage) throws IOException {

        URL resource = LoginApplication.class.getResource("/pages/login.fxml");
        FXMLLoader loader = new FXMLLoader(resource);

        //背景音乐
        URL musicF = LoginApplication.class.getResource("/sound/music.wav");
        AudioClip audioClip = new AudioClip(musicF.toString());
        audioClip.setCycleCount(-1);
//        audioClip.play();

        Scene scene = new Scene(loader.load(), 800, 600);
        stage.setTitle("植物大战僵尸登录界面");
        stage.setScene(scene);
        stage.show();
    }

    public static void main(String[] args) {
        launch();
    }
}
